package com.ldb.Controller.service;

import java.util.List;

import com.ldb.Controller.dao.CommitteeDao;
import com.ldb.Controller.entity.Committee;

public class CommitteeManager {

	private CommitteeDao committeeDao;
	
	public void setCommitteeDao(CommitteeDao committeeDao) {
		this.committeeDao = committeeDao;
	}
	
	public CommitteeDao getCommitteeDao() {
		return this.committeeDao;
	}
	
	public void addCommitte(Committee committee) {
		this.committeeDao.addEntity(committee);
	}
	
	public void deleteCommittee(String committee_id) {
		this.committeeDao.deleteEntity(Committee.class, committee_id);
	}
	
	public Committee getCommitteeById(String id) {
		return this.committeeDao.getEntity("committee_id", id, Committee.class);
	}
	
	public void updateCommittee(Committee committee) {
		this.committeeDao.updateEntity(committee.getCommittee_id(), committee);
	}
	
	public List<Committee> getAllCommittees() {
		this.committeeDao.setClazz(Committee.class);
		return this.committeeDao.getEntityAll();
	}
	
}
